<div>
	<ul>
		<li><a href="<?php echo $this->url(array('ctrl' => 'questions'));?>" >Questions Home</a></li>
		<li><a href="<?php echo $this->url(array('ctrl' => 'questions','act' => 'csv'));?>" >Export CSV</a></li>
	</ul>
	

	<div>
		<label>Select Test</label>
		<select id="selectTest" >
			<option value="-1" >---------</option>
			<?php
				foreach ($this->tests as $test):
					?><option value="<?php echo $test->id;?>" ><?php echo $test->name.' --- '.$test->subject;?></option><?php 
				endforeach;
			?>
		</select>
	</div>
	<div id="questionsDetails" ></div>
</div>
<script type="text/javascript">
	$('#selectTest').change(function(){
		if(this.value == -1){
			return;
		}
		$.ajax({
			url :'<?php echo $this->url(array('ctrl' => 'questions','act' => 'qList'));?>',
			type:'get',
			data:'testId='+this.value,
			success: function(fromServer){
				$('#questionsDetails').html(fromServer);
			}
		});
	});
</script>